\(\int \frac {\sqrt {a+b x}}{\sqrt {-a-b x}} \, dx\) [816]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [C] (verification not implemented)
   Maxima [F(-2)]
   Giac [C] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 22, antiderivative size = 23 \[ \int \frac {\sqrt {a+b x}}{\sqrt {-a-b x}} \, dx=\frac {x \sqrt {a+b x}}{\sqrt {-a-b x}} \]

[Out]

x*(b*x+a)^(1/2)/(-b*x-a)^(1/2)

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {23, 8} \[ \int \frac {\sqrt {a+b x}}{\sqrt {-a-b x}} \, dx=\frac {x \sqrt {a+b x}}{\sqrt {-a-b x}} \]

[In]

Int[Sqrt[a + b*x]/Sqrt[-a - b*x],x]

[Out]

(x*Sqrt[a + b*x])/Sqrt[-a - b*x]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 23

Int[(u_.)*((a_) + (b_.)*(v_))^(m_)*((c_) + (d_.)*(v_))^(n_), x_Symbol] :> Dist[(a + b*v)^m/(c + d*v)^m, Int[u*
(c + d*v)^(m + n), x], x] /; FreeQ[{a, b, c, d, m, n}, x] && EqQ[b*c - a*d, 0] &&  !(IntegerQ[m] || IntegerQ[n
] || GtQ[b/d, 0])

Rubi steps \begin{align*} \text {integral}& = \frac {\sqrt {a+b x} \int 1 \, dx}{\sqrt {-a-b x}} \\ & = \frac {x \sqrt {a+b x}}{\sqrt {-a-b x}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00 \[ \int \frac {\sqrt {a+b x}}{\sqrt {-a-b x}} \, dx=\frac {x \sqrt {a+b x}}{\sqrt {-a-b x}} \]

[In]

Integrate[Sqrt[a + b*x]/Sqrt[-a - b*x],x]

[Out]

(x*Sqrt[a + b*x])/Sqrt[-a - b*x]

Maple [A] (verified)

Time = 0.60 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00

method result size
default \(-\frac {\sqrt {b x +a}\, \sqrt {-b x -a}}{b}\) \(23\)
risch \(-\frac {i \sqrt {\frac {-b x -a}{b x +a}}\, \sqrt {b x +a}\, x}{\sqrt {-b x -a}}\) \(40\)

[In]

int((b*x+a)^(1/2)/(-b*x-a)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-(b*x+a)^(1/2)*(-b*x-a)^(1/2)/b

Fricas [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.57 \[ \int \frac {\sqrt {a+b x}}{\sqrt {-a-b x}} \, dx=-\frac {\sqrt {-b^{2}} x}{b} \]

[In]

integrate((b*x+a)^(1/2)/(-b*x-a)^(1/2),x, algorithm="fricas")

[Out]

-sqrt(-b^2)*x/b

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.86 (sec) , antiderivative size = 53, normalized size of antiderivative = 2.30 \[ \int \frac {\sqrt {a+b x}}{\sqrt {-a-b x}} \, dx=\begin {cases} 0 & \text {for}\: \frac {1}{\left |{\frac {a}{b} + x}\right |} < 1 \wedge \left |{\frac {a}{b} + x}\right | < 1 \\- i \left (\frac {a}{b} + x\right ) & \text {for}\: \frac {1}{\left |{\frac {a}{b} + x}\right |} < 1 \vee \left |{\frac {a}{b} + x}\right | < 1 \\- i {G_{2, 2}^{1, 1}\left (\begin {matrix} 1 & 2 \\1 & 0 \end {matrix} \middle | {\frac {a}{b} + x} \right )} - i {G_{2, 2}^{0, 2}\left (\begin {matrix} 2, 1 & \\ & 1, 0 \end {matrix} \middle | {\frac {a}{b} + x} \right )} & \text {otherwise} \end {cases} \]

[In]

integrate((b*x+a)**(1/2)/(-b*x-a)**(1/2),x)

[Out]

Piecewise((0, (Abs(a/b + x) < 1) & (1/Abs(a/b + x) < 1)), (-I*(a/b + x), (Abs(a/b + x) < 1) | (1/Abs(a/b + x)
< 1)), (-I*meijerg(((1,), (2,)), ((1,), (0,)), a/b + x) - I*meijerg(((2, 1), ()), ((), (1, 0)), a/b + x), True
))

Maxima [F(-2)]

Exception generated. \[ \int \frac {\sqrt {a+b x}}{\sqrt {-a-b x}} \, dx=\text {Exception raised: RuntimeError} \]

[In]

integrate((b*x+a)^(1/2)/(-b*x-a)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negative exponent.

Giac [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.27 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.52 \[ \int \frac {\sqrt {a+b x}}{\sqrt {-a-b x}} \, dx=\frac {-i \, b x - i \, a}{b} \]

[In]

integrate((b*x+a)^(1/2)/(-b*x-a)^(1/2),x, algorithm="giac")

[Out]

(-I*b*x - I*a)/b

Mupad [F(-1)]

Timed out. \[ \int \frac {\sqrt {a+b x}}{\sqrt {-a-b x}} \, dx=\int \frac {\sqrt {a+b\,x}}{\sqrt {-a-b\,x}} \,d x \]

[In]

int((a + b*x)^(1/2)/(- a - b*x)^(1/2),x)

[Out]

int((a + b*x)^(1/2)/(- a - b*x)^(1/2), x)